<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="module">
       // js nlp  transformers.js
       // transformers.js nlp框架
       // 下载LLM
       // pipeline  核心模块 nlp任务
import {
    pipeline, // pipe 模块， 派出一个任务
    env // 环境
    // 华为智驾
} from 'https://cdn.jsdmirror.com/npm/@xenova/transformers@2.6.0'
env.allowLocalModels = false;   // 不要加载本地大模型
// react loading 组件告知用户？？
let pipe = await pipeline('sentiment-analysis') // 分类
let result = await pipe('I love transformers') 
console.log(result);
let result2 = await pipe('I hate 唐氏')
console.log(result2);    
</script>
</body>
</html>